package com.ny.wlw;

import java.io.*;

public class Test05 {
    public static void main(String[] args) throws IOException {
        String data ="想干饭";
        BufferedWriter writer =new BufferedWriter(new FileWriter("2.txt"));
        writer.write(data);
        writer.close();
        BufferedReader reader = new BufferedReader(new FileReader("2.txt"));
        StringBuilder content =new StringBuilder();
        String line;
        while ((line=reader.readLine())!=null){
            content.append(line);
        }
       reader.close();
        System.out.println(content.toString());
    }
}
